<?php

class Business_Location {
	
    public static function getAllId(){
        try {
            $db = Core_Global::getDatabase();
            $stmt = $db->prepare('select LocationID from location');
            $stmt->execute();
            $result = $stmt->fetchAll();
            return $result;
        } catch (Zend_Exception $e) {

            return array();
        }
    }

    public static function get($params){
        try{
            $db = Core_Global::getDatabase();

            $stmt = $db->prepare('select * from location where type='.$params['type'].' and parentId like "%'. $params['parentID'].'%"');
            $stmt->execute();
            $result = $stmt->fetchAll();
            return $result;
        }catch (Zend_Exception $e){

        }
    }
	
}